using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TextEditor
{
    public partial class dlgDivProperty : DevComponents.DotNetBar.Office2007Form
    {
        
        public ZYTextDiv DivObject = null;

        public dlgDivProperty()
        {
            InitializeComponent();
        }

        private void cmdOK_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.OK;
            if (this.DivObject != null)
            {
                this.DivObject.ID = this.txtName.Text.Trim();
                this.DivObject.Title = this.txtTitle.Text;
                this.DivObject.HideTitle = this.chkShowTitle.Checked;
                this.DivObject.NoContent = this.chkCanHaveContent.Checked;
                this.DivObject.TitleLine = this.chkTitleLine.Checked;
                this.DivObject.OwnerDocument.Modified = true;
            }
            base.Close();
        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void dlgDivProperty_Load(object sender, EventArgs e)
        {
            if (this.DivObject != null)
            {
                this.txtName.Text = this.DivObject.ID;
                this.txtTitle.Text = this.DivObject.Title;
                this.chkShowTitle.Checked = this.DivObject.HideTitle;
                this.chkCanHaveContent.Checked = this.DivObject.NoContent;
                this.chkTitleLine.Checked = this.DivObject.TitleLine;
            }
        }
    }
}